package com.easy.framework.database.page;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 分页器
 * @param <T>
 */
public class SimplePage<T> implements Serializable {
	
	private static final long serialVersionUID = 1L;
	/**
	 * 总数
	 */
	protected long total = 0;
	/**
	 * 数据列表
	 */
	protected List<T> rows=new ArrayList<>();

	public SimplePage() {
		
	}

	public SimplePage(long total,List<T> rows) {
		this.total = total;
		this.rows = rows;
	}

	public long getTotal() {
		return total;
	}

	public void setTotal(Long total) {
		if (total == null || total < 0) {
			this.total = 0;
		} else {
			this.total = total;
		}
	}
	public List<T> getRows() {
		return rows;
	}

	public void setRows(List<T> rows) {
		this.rows = rows;
	}
}